<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="layout" content="bocMain"/>
    <title>进件作业系统</title>

</head>

<body>
<div class="weui-search-bar opportunity-search" id="searchBar">
    <g:form class="weui-search-bar__form" action="businessTransaction">
        <div class="weui-search-bar__box">
            <i class="weui-icon-search"></i>
            <input type="search" name="query" class="weui-search-bar__input" id="searchInput" placeholder="订单编号，客户姓名，手机号" value="${params?.query}">
            <a href="javascript:" class="weui-icon-clear" id="searchClear"></a>
        </div>
        <label class="weui-search-bar__label" id="searchText">
            <i class="weui-icon-search"></i>
            <span>搜索</span>
        </label>
    </g:form>
    <a href="javascript:" class="weui-search-bar__cancel-btn" id="searchCancel">取消</a>
</div>
<div class="weui-tab">
    <div class="weui-navbar opportunity-bar">
        <div class="weui-navbar__item weui_bar__item--on" href="#tab1">

            <span>待审批</span>
        </div>

        <div class="weui-navbar__item" href="#tab2">

            <span>转人工</span>
        </div>

        <div class="weui-navbar__item" href="#tab3">

            <span>待落实</span>
        </div>

        <div class="weui-navbar__item" href="#tab4">
            <span>待放款</span>
        </div>

        <div class="weui-navbar__item" href="#tab5">
            <span>已放款</span>
        </div>

        <div class="weui-navbar__item" href="#tab6">
            <span>已拒绝</span>
        </div>
    </div>

    <div class="weui-tab__bd opportinityList">
        <div id="tab1" class="weui-tab__bd-item weui-tab__bd-item--active">
            <g:each in="${opportunityList}">
                <div class="weui-cells">
                    <div class="weui-cell">
                        <div class="weui-cell__bd">
                            <p>
                                订单（进件）编号：<a href="/BocAppOpportunity/businessTransactionOpportunity/${it?.id}" class="serialNumber">${it?.serialNumber}</a></p>
                        </div>

                        <div class="weui-cell__ft stage">待审批</div>
                    </div>

                    <div class="weui-cell">
                        <div class="weui-cell__bd">
                            <p>客户：${it?.contact?.fullName}</p>
                        </div>

                        <div class="weui-cell__ft">客户手机：${it?.contact?.cellphone}</div>
                    </div>

                    <div class="weui-cell">
                        <div class="weui-cell__bd">
                            <p>申请金额：${it?.requestedAmount}</p>
                        </div>

                        <div class="weui-cell__ft">借款期限：${it?.loanDuration}月</div>
                    </div>

                    <div class="weui-cell last-item">
                        <div class="weui-cell__bd">
                            <p>产品：${it?.product?.name}</p>
                        </div>

                        <div class="weui-cell__ft">${it?.createdDate.format("yyyy-MM-dd")}</div>
                    </div>
                </div>
            </g:each>
        </div>
</div>
<script>
    $(function () {
        $("#searchBtn").click(function () {
            $(".searchForm").submit();
        });
        function helpMessage(message) {
            $(".helpMsg").text(message).fadeIn(200);
            setTimeout(function () {
                $(".helpMsg").fadeOut(200);
            }, 2000);
        }


        // //分页请求数据
        // getList()
        // function getList() {
        //     var query = $("#searchInput").val();
        //     var status = 'pending';
        //     $.ajax({
        //         type: "POST",
        //         url: "/bocAppOpportunity/businessTransactionList",
        //         async: false,
        //         data: {"query":query,"status":status,"offset":0,"max":10},
        //         success: function (data) {
        //             var source   = $("#entry-template3").html();
        //             var template = Handlebars.compile(source);
        //             var oplist=data.opportunityList
        //             var html    = template(oplist[0]);
        //             document.getElementById("tab2").innerHTML = html;
        //         },
        //         error: function (data) {
        //             alert(data)
        //         }
        //     });

    })
</script>
</body>
</html>
